<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta charset="utf-8">
    <title>课程顾问统计</title>
    <link rel="shortcut icon" href="${pageContext.request.contextPath}/favicon.ico"/>
    <link rel="bookmark" href="${pageContext.request.contextPath}/favicon.ico"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/webjars/layui/css/layui.css" media="all">
    <script type="application/javascript" src="${pageContext.request.contextPath}/webjars/layui/layui.js"
            charset="utf-8"></script>
    <script type="application/javascript" src="${pageContext.request.contextPath}/webjars/jquery/jquery.js"></script>
    <script type="application/javascript"
            src="${pageContext.request.contextPath}/private/js/loading/ajaxloading.js"></script>
</head>
<body>
<fieldset class="layui-elem-field">
    <legend>查询条件</legend>
    <form id="form1" class="layui-form" action="">
        <table width="96%" align="center">

            <tr height="23">
                <td align="center">顾问姓名:</td>
                <td>
                    <input id="advisername" name="advisername" class="layui-input" type="text" placeholder="请输入顾问姓名"
                           autocomplete="off"
                           lay-verify="advisername">
                </td>
                <td align="center">销课经办时间起:</td>
                <td>
                    <input id="starttime" name="starttime" class="layui-input" type="text" placeholder="yyyy-MM-dd"
                           autocomplete="off"
                           lay-verify="starttime">
                </td>
                <td align="center">销课经办时间止:</td>
                <td>
                    <input id="endtime" name="endtime" class="layui-input" type="text" placeholder="yyyy-MM-dd"
                           autocomplete="off"
                           lay-verify="endtime">
                </td>
            </tr>
            <tr height="23">
                <td colspan="6" align="center">
                    <button class="layui-btn" lay-submit lay-filter="query">查询</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </td>
            </tr>
        </table>
    </form>
</fieldset>

<fieldset class="layui-elem-field">
    <legend>查询结果</legend>
    <table class="layui-table" lay-filter="gridfilter"
           lay-data="{url:'',page:true, id:'gridresult',height:'330px'}">
        <thead>
        <tr>
            <th lay-data="{field:'adminnid',hide:true}">顾问id</th>
            <th lay-data="{field:'username',align:'center'}">顾问姓名</th>
            <th lay-data="{field:'usercount',align:'center'}">管理会员人数</th>
            <th lay-data="{field:'classcount',align:'center'}">总课时数</th>
        </tr>
        </thead>
    </table>

</fieldset>
</body>

<script type="application/javascript">
    layui.use(['form', 'table','laydate'], function () {
        var form = layui.form;
        //日期控件
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#starttime' //指定元素
        });
        laydate.render({
            elem: '#endtime' //指定元素
        });

        //数据表格模块
        var table = layui.table;
        table.reload('gridresult', {
            url: '${pageContext.request.contextPath}/eyas/stats/statsAdviser'
            , where: {} //设定异步数据接口的额外参数
            , page: {
                curr: 1
            },
            method:'get'
        });
        //监听提交
        form.on('submit(query)', function (data) {
            table.reload('gridresult', {
                url: '${pageContext.request.contextPath}/eyas/stats/statsAdviser'
                , where: data.field //设定异步数据接口的额外参数
                , page: {
                    curr: 1
                },
                method:'get'
            });
            return false;
        });



    });
</script>
</html>
